package com.schrodinger.zwebservice.axis2.client;

import com.schrodinger.zwebservice.axis2.client.wsconfig.WSConfigManager;

/**
 * 使用舉例：一般是在service層調用
 * 
 * @author asus
 * 
 */
public class Axis2ClientTest {

	// WS远程调用服务标志
	private static final String SERVICE_MARK = "zbdp";
	// WS远程调用的服务名称
	private static final String SERVICE_NAME = "orgWSInterface";
	// WS远程调用的类的全路径名称或者生成wsdl的targetNameSpace
	//private static final String TARGET_CLASS = "http://impl.wsapi.org.system.module.zbdp.schrodinger.com";
	private static final String TARGET_CLASS = "com.schrodinger.zbdp.module.system.org.wsapi.impl.OrgWSInterfaceImpl";

	public String getTopOrg() throws Exception {		
		String resultStr = Axis2Client.invokeMethodHasReturn(SERVICE_MARK,
				SERVICE_NAME, TARGET_CLASS, "getTopOrg", new Object[] {});
		return resultStr;
	}

	public static void main(String[] args) throws Exception {
		Axis2ClientTest axis2ClientTest = new Axis2ClientTest();
		WSConfigManager.loadWSConfig();
		String topOrgInfo = axis2ClientTest.getTopOrg();
		System.out.println("topOrgInfo:" + topOrgInfo);
	}

}
